package day10_poly.demo06_poly;
//人去逛动物园，给动物园里的动物喂食
public class Person {
    public void eat00(Cat cat){
    }
    //匿名类:首要条件就是多态
    public void eat01(){
        Dog dog=new Dog();
        dog.eat();
    }
    /*
    Dog extends Animal{
        @Override
        public void eat() {
            System.out.println("狗吃东西");
    }
     */
    //不知名动物
    public void eat02(){
        Animal animal = new Animal(){
            @Override
            public void eat() {
                System.out.println("不知名的动物吃东西");
            }
        };
    }
}
